using System.Web.Mvc;
using Coderoom.ScrumPlanner.Web.Helpers;
using Xunit;

namespace Coderoom.ScrumPlanner.Tests.Unit.MvcTests
{
	public class StaticResourceExtensionTests
	{
		private readonly HtmlHelper htmlHelper;

		public StaticResourceExtensionTests()
		{
			htmlHelper = new HtmlHelper(new ViewContext(), new ViewPage());
		}

		[Fact]
		public void LinkCssFile_returns_html_link_tag()
		{
			// act
			var result = htmlHelper.LinkCssFile("somefile.css");

			// assert
			Assert.Equal("<link href=\"/styles/somefile.css\" rel=\"stylesheet\" type=\"text/css\" />", result);
		}

		[Fact]
		public void LinkJsFile_returns_html_script_tag()
		{
			// act
			var result = htmlHelper.LinkJsFile("somefile.js");

			// assert
			Assert.Equal("<script src=\"/behaviors/somefile.js\" type=\"text/javascript\"></script>", result);
		}
	}
}